package net.tankwar.event;

import javafx.scene.image.Image;
import javafx.scene.input.MouseButton;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import net.jumpengine.M;
import net.jumpengine.Manager;
import net.jumpengine.bean.Base;
import net.jumpengine.enume.GameState;
import net.jumpengine.inter.IAction;
import net.jumpengine.inter.IStateEvent;
import net.jumpengine.po.Border;
import net.jumpengine.ui.ButtonBase;
import net.jumpengine.util.UDraw;

public class StartStateEvent implements IStateEvent {
	private boolean load=false;

	@Override
	public void setBackImage(Image image) { }

	@Override
	public boolean isLoaded() {
		return load;
	}

	@Override
	public void load() {
		Border border=new Border(10, 10, 5, 15, 6);
		Font font = UDraw.getFont("楷体", 30, true, true);
		ButtonBase btu=new ButtonBase(100, M.h()-300, 261, 85,border, "地图编辑器");
		btu.setColor(Color.DARKMAGENTA);
		btu.setBackColor(Color.BURLYWOOD);
		btu.setFont(font);
		btu.setAction(new IAction() {
			@Override
			public void handle(int x, int y, MouseButton button, Base base) {
				Manager.setState(GameState.edit);				
			}
		});
		
		load=true;
	}

	@Override
	public void show() { }

	@Override
	public void pause() { }

	@Override
	public void end() { }

}
